#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) {
    int k = m + n - 1;
    int pointer1 = m - 1, pointer2 = n - 1;
    while (pointer2 >= 0)
    {
        if (nums2[pointer2] >= nums1[pointer1])
            nums1[k--] = nums2[pointer2--];
        else
            nums1[k--] = nums1[pointer1--];
    }
}
int main()
{
    int nums1[6] = {1,2,3,0,0,0 };
    int nums2[3] = { 2,5,6};
    merge(nums1, 1,0, nums2,1, 1);
    for (int i = 0; i < 6; i++)
        printf("%d ", nums1[i]);
    return 0;
}